/*
 * @Description: Test.java
 * @Author: rendc
 * @Date: 2025-08-05 09:18:35
 * @LastEditors: rendc
 * @LastEditTime: 2025-08-05 09:29:56
 */

public class Test {

  public static void main(String[] args) {
    // // 实际开发中创建动物类对象无意义
    // Animal animal = new Animal();
    // // 实际开发中调用动物类方法无意义
    // animal.eat();
    // animal.sleep();
    Dog dog = new Dog();
    dog.eat();
    dog.sleep();

    Cat cat = new Cat();
    cat.eat();
    cat.sleep();

    System.out.println("--=--=--=--=--=--");

    // 多态实现
    Animal c = new Dog();
    c.eat();
    c.sleep();
    c = new Cat();
    c.eat();
    c.sleep();
  }
}